# $Id: PKGBUILD 169011 2012-10-17 10:20:03Z allan $
# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: William Rea <sillywilly@gmail.com>
pkgbase=python-chardet
pkgname=('python-chardet' 'python2-chardet')
pkgver=2.0.1
pkgrel=6
arch=('any')
url="http://chardet.feedparser.org"
license=('LGPL')
makedepends=('python' 'python2')
#source=(http://chardet.feedparser.org/download/python2-chardet-${pkgver}.tgz
#        http://chardet.feedparser.org/download/python3-chardet-${pkgver}.tgz)
source=(ftp://ftp.archlinux.org/other/$pkgbase/python2-chardet-${pkgver}.tgz
        ftp://ftp.archlinux.org/other/$pkgbase/python3-chardet-${pkgver}.tgz)
sha256sums=('56fa0c37189b0a5f082d064dec59d69a044aaa3eeb7acb9b3081e2ba306deaa4'
            '2b9a1e6a4e719ae3a3e19ccfe0b88cf2c74f3083c36ecac7451a64428a60a1af')

package_python-chardet() {
   depends=('python>=3.3')
   pkgdesc="Python3 module for character encoding auto-detection"
   cd "${srcdir}/python3-chardet-${pkgver}"
   python setup.py install --root="${pkgdir}" --optimize=1
}

package_python2-chardet() {
   depends=('python2>=2.7.1')
   pkgdesc="Python2 module for character encoding auto-detection"
   cd "${srcdir}/python2-chardet-${pkgver}"
   python2 setup.py install --root="${pkgdir}" --optimize=1
}
